bug fix in Rep