add validation for invalid words
add encoding
change mysql to mysql2