Move sleep inside first check, add recheck