Added packet handling