added hooks functionality