Security error: mid value must be a number