fix javascript validation