fixing potential crash in direct collections.