Fixed a bug in onreadystatechange