Implemented action validity checking.