Adapted to changes in code