Fix display and animate bug and add $template