fix conditionals around modal