writeProfile method