Fixed hooks, added a new util file