TENSIONS were running high when your correspondent visited Sweden at the height of Europe’s migrant crisis, in late 2015. Although most Swedes happily accepted the 163,000 asylum-seekers who arrived in their country that year, others were far less welcoming. In Malmo, a heavily immigrant city in the south, one cashier in a local shop was particularly angry. “They are just here for welfare and benefits,” he said, before telling your correspondent to “get out”. Such language was once the preserve of politicians from the far-right Sweden Democrats party, which has capitalised on the crisis to boost its support. Since then the government has been trying to adapt the Swedish welfare state to suit the times: both to accommodate hundreds of thousands of refugees and to try to diminish such right-wing sentiment. What is changing?

Swedes are rightly proud of their welfare state. The “Scandinavian model” combines high taxes, collective bargaining and a fairly open economy. The result is excellent living standards, high wages and impressive rates of female labour-force participation (parental leave is generous for both sexes). Its reputation has leftist politicians elsewhere filled with envy: Bernie Sanders has cited Sweden, and its neighbour Denmark, as his ideal of “social democracy”. Yet the system has long been in need of reform. Like much of Europe, Sweden has an ageing workforce. Decades of under-construction has sent house prices soaring in Stockholm and other cities. High wages leave many unskilled workers, both Swedish and foreign-born, on the fringes of the labour market.

The first response by the centre-left coalition government to the overwhelming influx of refugees in 2015 was to close the border with Denmark. This was seen as an extreme measure: the deputy prime minister, Asa Romson, cried when announcing the move at a press conference. Since then it has also tried to tweak welfare spending. Previously, failed asylum-seekers received a monthly cash benefit of around 1,200 SEK ($140) and housing; this was scrapped last year. On May 31st the government voted to limit paid parental leave for immigrants: previously, refugees could claim the full amount of paid leave (480 days per child under the age of eight). Now they can only do so if the child is under one year old. For big families the benefits will be limited further.

These tweaks, however, do not tackle the biggest problem Sweden faces in integrating new arrivals: its rigid labour market. Many refugees do not have the skills or connections to enter the workforce. Sweden has one of the largest gaps in employment between native and foreign-born workers. This damages the welfare state not only because fewer foreign-born workers pay taxes, but also because some Swedes, like the cynical cashier in Malmo, resent their new neighbours and lose trust in the state. If Sweden is to remain exceptional—for its high living standards and generous attitude to people fleeing barrel bombs—far bigger changes are needed.