Added window procedure