bug fix to flow energy check