use singleton function in spec