fixed handling for null or empty String