Added check for request success