make while work, this just needed another check of the condition