add configuration for threshold and limit