use callback function instead of member