Function to check for value, return NULL if not found.