added debugging to ajax error reporting