make the after_commit conditional as well