add button loading animation
some logic redesign