Fixed possible crash on DB update