added code to set null flag.