improved required fields check before submission