fix bug in validPosition that always return True