Implemented file closing and fixing save as