change check to getattr