add javascript implemention