function name changed and fix NULLing of valueID