fixed #43 close the lockWaitDialog and the releaseWaitDialog after an error