fixed permission error on lock_dir