error handling and clean up
Added category string to notes