add swipe events and fixed popup