Fixed logic and added new message for empty field situation.