fixed javascript problem