better key syntax checking