error handling for empty string