added check for NULLtoNA