fixed wrong window switching