fixed validation check for empty or null