implemented RPC slicing and fixed handling, close #1477