added messages to invalid element errors