bug fix and new class SpaceEntity