added error diagnosis bug