fixed javascript samples