Fix keyerror in dispatcher