add status code check