added optional directory remove