fix and clean up