Fixed wrong cast