bug fix for GEM