added trace and changed send