Changed workflow for new and close buttons