fixed bugs in filereceivethread