recompled library, so it can handle closing of Simple_window without pressing "Next Button"