fix debug message that was causing error type being masked as a TypeError