histogram stretching bug fix