Fixed type mismatch issue