implement queryById