bugfix for infinite loop go