fix frame typo and broken pack_error logic