fix required fields check