Loading animation with recursion