solved a bug with infinite reloading