now works without directory changing support