added packet handling to gui