Fixing db.getResult function.