fixed bug with date comparation