Fix to critical bug