Reimplement lock (move from preferences to regular file)