js to finish