change to write directly the profile