Change debug msg to err msg (debug doesn't seem to output)