Fixing potential navigation bug using the back button