added animate out functionality