fix xhr state check in php-error