Fixed bug in testing datea