fixed nil problem