added _socket to middleware
preparing for release