Added code to the control script so it will recognize when it is in a pen.