change pack flow controll from server-side to front-end