auto-determine controller value in a slightly better way