Optimize frame step back to break loop after proper pin was found