Add proper verification and error reporting via defer