Updated hooks.py