adding pry and better errors