fix loop issue kind of