Added back some functionality to find error after commenting it out