improved error handling in translation plugin