fixing use of onreadystatechange