Fixed to work with code optiptimalisation