Fix singleton code