Fixes an error when no swiping occurs