add finish when error happened