fixing reporting bug and optimization