fix logic error when pulling date from object