fixed bugs: bind in handleRequests, set flag in newPack, write in server