Fix on dead lock
Avoid NPE on repository shutdown