Added refresh to avoid animation problems if you leave window