Added finalize method