fixed corner case where variable is uninitialized sometimes