make sure operations are run in proper order