Fix the final backtrackign. Thanks to @ckris