cleanup + bugfix