Fixed the finalize session call