implement category adding in transactions