add checking to write activity + fixed date issues