[bugfix] avoid crash by unspecified side-effect order