fixed some bugs on cleanDistro() function