added a recursive method to get stage text