fix the condition off by a digit