Fixed issue with page refresh