Fixed error variable not being initialized