fixes a bug where activity time is not calculcated properly