fixed problem of external script with ajax