fixed the last of the $res issues