bugfix in prep_for_robot