took packet outside ajax