FIXED: Updated javascript for requested behavior