Fixed InvalidCastException