added getdefault method and demo