fixed javascript issues