fix bug on first day ajax call