fix database overwrite