better type-checking for remote handler in PixelPaint