Move write call to shared before section