Make it refresh on resize and prevent some crashing