check ua before accessing ua.major

Check for variable before accessing a property