Fixed overwrite bug