fix bug with ajax fetch