#114 - visibility issue
#90 - only update cwd state if stat succeeds