added functionality for the quit function that if its the same as the opened file, it will just exit.