fix busy loop