fixed error of getting empty instance inside transactions