Fix flush queue in commit