updated check for empty string