adding js version
cleaner exiting