bufix throw exception in a function that is noexcept