fixed bug in getInstance