Implemented boundary check for servo.