fixed a bug in the retrieval of prior dates
correcting typos