cleanup loose ends