cleanup and add more info about possible failures