Fixing javascript precedence problem in WK