fixed bugs with reloading.