Fixed overwriting problem