fix nil or empty string check for return