Added conditions for modals