fix for  nil issue