errorcode on closing