Trying to fix 'res' bug