change throw error in layout