added conditional action check