updated gem code