cleanup and fix