js fix for required fields