setup parameters first before calling