Check if the flag exists inside the function + change the id for each file (#88)