Fix timeout bug, thx to Florian Knorn for reporting this