Adjusted code to prevent failure.