fixed bug in tool
fixing memory bug and adding a cap on log size