move updated key to first or last