added protection against invalid board values