fixed some issues with page reloading