Added error if key is bad