throwing exception when improper name is supplied