added check of aggregate functions in validation