handling string cast error