Fixing bug in getInstance