Fixing navigation bug where active item was occationally wrong