fixed isinstance to include Classes