clean up timeoutid code