fix a bug that null was treated as 0