fixed encoding and agregation