cleanup and fix issues