fixed error checking on long name