modification to expression handling

curtesy of Stas