fixed instance counting