fix bug where working directory wasn't being set correctly