pure js version added