fixed nil ref