minor fix to recalculate_window method