handle transaction better