finalizing js