fix check for key in array