updated parser to handle empty string