Added 3 js validation functions