make bug fix for allow_none in Instance class, write add_trait recaste_trait, remove_trait