Action validity checking added.