fix wait handler should close connection if client leaves