A Calgary energy company is apologizing after some employees found out they had lost their jobs when they showed up at work and no longer had access to certain computer applications.

Cenovus Energy said that staff lost access to the systems prematurely on Wednesday.

“We made a mistake on what has already been a very difficult day and we are so sorry that this has … added stress for some of our staff,” spokesman Brett Harris told CTV Calgary.

Cenovus has reduced staff by 540 people over the past week.

The company’s profit dropped sharply to $126 million in the second quarter, from $615 million a year earlier, after rapidly-declining energy prices caused revenue to fall from $5.42 billion to $3.73 billion, according to The Canadian Press.

This is a corrected story. An earlier version said the employees lost access to key cards and cellphones.