not setting pieces correctly causing error