Better checking using trim and empty string.