fixed infinite loop again