updating listener to fix a few socket bugs