fixed typo in writeToLS()