modified getMarkup()
wired up the error checking code