Use array_key_exists instead of in_array

Change-Id: I5ea50d142555dbe4112867068bebaeba7afa3899