Rewrote socket input to capture users query