added some exception handling to avoid marshalling and serialization exceptions
Signed-off-by: Martin Sperl <github@martin.sperl.org>