fixed javascript preview issue