added stats tracking for idle disconnects
moved timeout code to its own function
added verbose output for debugging