change action to functions