fixing animation bug