updated to use message rather than a hack