added two hooks