finish the bg and fg