fix pack length bug