Updated to work with settings