fix bug when determining moves