patched Null Value bug
modified a bug when using aggregate function