added tomeout for interrupted socket connection; added change dir for, for correct file imports