fixed checking whether array key is set