changes global alert error handling to work with the new API
fixes type warnings