Added functionality to refresh window.