change to use javascript