Fix Database error: undefined
Fix count returns IDBRequest instead of result