fixed bug with extracting date