added fuctionality to all modals