add check on beginning transaction twice