why doesn't this always return NULL?