fix a foreach stmt type checking - related to #12