fixing issue with exists where statusCode was not properly checked on error conditions