javascript require fix