fixed bug for swiping