Fix login error with $db and DB-class