polished the finish script