corrected typo
added js unit test