Finalize javascript