added new leave functionality