writing and init error fixes