added function and css for modals