added encoding to failsafe plugin