added logic to connect two actions