Retract tool if end of drilling is detected