built more robust search type checker