js validation file bug