catch runtimeerror when writing to slave