set the prev before checking and possibly hitting the break