Fixing bad method that could close all windows