Fixed recursiveness in doAction