Fix the onreadystatechange function