clean backend and change the way of check dates