implement conditional action in the backend