fixed the process of appling hooks