type check the statements