Required fields not working properly