fixing write back bug