Change order of keyword checking