merging patches from assaf.