two very desparate hacks to get things working again on mex.  these need to be cleaned up when the bugs are resolved