Add support for finalize method in LSF