Add function to delete extra trailing newlines before file save