ajax in script. Minor updates