fix bug of checking ajax call result