Fix deadlock at startup