adds better handling for IM format from em client