Fix potential background crash after upgrade
