fix bugs in initializing bean and space tree