bridge: move marshall call so that an error gets reported instead of crashing process