Add exceptions handling