use terrible hacks to make this work when rails tries to marshal