enable javascript to be called multiple times