created simple singleton example in js