Fix filter write order bug