bug in writeBack() fixed