Fixed so it refreshes at the right time.