Fixing the bug in navigate.