fixed null error issue