added checking if the user did any edits, and if the user did not save and tries to quit, there will be a warning alert