add function to reload the window on cancel button