fix cannot be cast