this line looks too long. I think gjslint will complain.  Using an if statement is probably better style here anyway.