add packet cast to E and Fix ATR

add packet cast to E and Fix ATR