Adds error messages via javascript