Fixed: my variable $rs masks earlier declaration