fixed checking for array key being set