window is not refreshing every call