Added error handling to histogram pt division