deleting the new line which was added at the end of the file