Remove unnecessary queries from controller
DB setting fix