working with ajax and js global