Added validation for empty fields