Fixed issue with multiple socket handlers