added some variables, cancel animation function