Add writing lock file