fix lottery bug