Fixed timeout behaviour
Added type signature to fix warning