add pry for more convenient debugging
fix encoding issue