removes _directory variable