Bugfix writing error