fixed NULL problem