BUG: check the dtype not the instance