added mainPid to topic restore/edit hooks