add 'apply' parameter to make immediate application optional