fixed broken javascript