potential cast error fix