minor changes to main class, fixed stringent emtpy folder issue