Fixing Crash on navigates away