finish material function