Fixed userAgent.indexOf chek

Index of returns -1 instead of a false boolean value. Fixed if case.