add leave functionality