Added functionality to the modals