Added code to make email modal functional