Fix checking key in array