writer working correctly