fixing database hooks