store flags in separate collection
catch exception
catch error