adds checks and tests for setting working dir