add codes for singleton