fixed one of the weird self/this variable inconsistencies, replaced multiple userAgent references with a variable to store navigation.userAgent