fixed nil issue