throw error when debug