added a method to set animation duration