fixed bugs with formatting date and transforming data before storing in
database