fixed error with js output