BUGFIX lost reference struct in cleanup