Attempting to remove infinite loop