use array_key_exists instead of in_array()