Pass error messages and element