added aggregated postStats and fixed bug in file upload