fix SQL NULL value problem