Fixed bug with current page refreshing