Fixed type assertion error