properly keep track of current working directory