Logo added
Fixed returning last material_id