Fixed so that error window is cleared between runs