fixed unit bugs