cleanup is first because it won't run in your version if there is an error, though should probably check it there instead of returning it.