add pry gems and fix a bug