fixed null exeption error