validate js bug fix