changed to return error if value is not a pointer.