Replaced function with do action rather than direct function call