come back to previous directory at the end of each function