amd to pass window instance