Fixed error in add_resource where the client was not being copied to memory