Finish functionality and handling exceptions