Implemented leaving team functionality