fix bugs finish functions