beginning transaction properly