Fixed a bug in touch navigation logic