Improvement: State will be deleted if any exception occurred