Made transaction work properly