Adding a 'close' event for client usage