Fixed pyhooks bug