hooks and some changes