Replaced location.href=?? statements with neater ui.navigate(...) calls