Added additional hooks and fixed issues