moved accepted flag change into transaction where it belongs