added close function
closing in on animation