better way to do previous commit