Fix status code check