Fixing empty in write context error