"This field is required" error appears even though the field is already filled