fix bug: controller gets invoked twice