adding hooks, pthread and cb are the important ones