Added temporary fix for nil pointer dereference panic.