fixed bug with type_exists