use callback function in model