making sure commit happens first