Correcting buggy way of calculating chat duration