a very simple type validation for DEBUG purpose