Debug messages must go via the print-makro
Handle timeoutstate