added animation and loading state