Added check in getDuration