Fixed crash when search material