tried to fix cast problem