set callbacks for window