Added failure message and fixed ID errors