Changed in_array to array_key_exists when adding new data