Convert resource to hash before slicing it