ajax commands are included only when necessary