Fixed nil error reference