modify error controller
fix bugs that caused by merging an array with a string