Fixed error control to use built-in panic err