use separate bail function (instead of invalid function) in cases there statefile should not be deleted