setting up hooks