fix exception handling
adapt code to use one file per note