added changes for checking empty fields on submit