Added managehook for terminal