fixed [] for nil error