Add swipe detection to prevent error