implmented pi register and forwarding