Changed name sending function to an AJAX call instead of a socket.io event.