fix durationFunc