changed type assertion to []