Casting for returned data + future error handler