type check process to prevent reference errors