fixing casting