Moved user_logged_in? from helper to controller. As expected, not work in controller.