better error checking for variable names