Added RetrieveStatusCode handler function