fixed null check issue