added support for removing directories too