add minor protections to os reading, and fix the bug while submitting data by js