fix #177, add a lock file for n