Remember to cleanup in case of an error