changed the logic of the required