added hooks for history