singleton using static and immediate function