create viewpager at correct time