Added console log statements to see flow of socket connection.