add timeout waiting for client input