Move javascript to correct place