updated parser to deal with folders