fixed demo script bug for empty gh-pages

Demo script now works if gh-pages is empty.