adds filtering to custom commands