Fixed if condition

> -1 instead of <= 0