added finish detection