Added reference to window in states