error function in forwardpos