`rs` is in the global scope here. Declare it (`var rs;`)