fix bug in canDoAction