added finish() api