socket close events
some vars and naming conventions