refine logic to check whether reloading bean is needed