Fix database refresh