checking for empty string in addition to null and undefined