fix to javascript

Signed-off-by: Zarrar Shehzad <czarrar@gmail.com>