Changed storing date as a string to storing it as a Date object