fixed error in d2h implementation