fixed bug with histogram