rook trapped modified
sync with master