fixing error for swiping