Added poll in each loop - now this should fix with previous bug