bugfix with date comparing