fixed bug in definition type checking