slightly lame fix for #798 (does not preserve ws)