add an explicit check that the return type is a hash