added code in error-handler to prevent dialog from appearing