Marked place of bug in aggregate function