try catch block for histogram