fixed undef value
remove empty folder too