fixed rendering bug with replace and changed all error messages to display on-page rather than in a popup