Fix bug where JSON error appears on views