added modal for chat codes, fixed JSON parsing errors, added reset option