Fixed events check in db class