fixed type checking in rpc plugin