change type check slightly, still not good enough