fixed bug with endless go routines