validate empty field and selected line