added code to javascript file