Pass animation duration as parameter