fixed a bug with that prevented to delete the pkg directory