implement base controller