move socket io function other file