before db change