Refactored the console window  it now keeps only 1000 lines and removes the ones at the end