fix bug
also add tests for user.dir