run action if action is not None