fixed javascript error