more typechecking to isinstance