remove peer function