fix summary processing logic