Added error code for bad category