before controller