implemented part of callproc