fixed return 0 after 7 attempts