corrected getting start date and inserting date into db