Bias of random variable
In the case $a$ is a random variable (r.v.) we distinguish between two types of unbiased: (hereinafter I'm switching to $\theta$ and $\hat{\theta}$ instead of $a$ and $\hat{a}$ respectively):


Unbiased in the strong sense: given by $E\left \{ \left (  \hat{\theta} - \theta \right )| \theta\right \} = 0, \quad \forall \theta$. Most often tha n not it is hard to satisfy this definition.
Unbiased  in the weak sense: given by $E\left \{  \hat{\theta} - \theta \right \} = 0, $ where the expectation is executed on all random terms inside. The meaning of this criterion is that you want the estimator to be unbiased "in the mean" and not for all values of $\theta$. This criterion can be calculated using the law of total expectation (smoothing theorem).