Added leave hooks to state